#!/usr/bin/python






## list


def alist():
    a = 'python小课'
    print(list(a)) #['p', 'y', 't', 'h', 'o', 'n', '小', '课']



# alist()




## list add
def elist():
    list = ['松','竹','梅']
    list[0] = '松树'
    print(list) #['松树', '竹', '梅']
    list.append('兰')
    print(list) #['松树', '竹', '梅', '兰']
    print(len(list)) ## print list length
    ## 删除元素
    del list[0]
    ## 提取元素
    print(list[1:2])
    print(list[:2])



# elist()


# dict
def adict():

    print('------dict-----------')
    group = {'师父':'唐三藏', '大师兄':'孙行者', '二师兄':'猪八戒', '沙师弟':'沙和尚'}
    print( group , type(group))
    print(group.keys())
    print(group.values())
    a = group.items()
    a = list(a)  # 转换为list好操作
    print(a[0])


# adict()











